extends RigidBody2D


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	# 锁定旋转
	self.lock_rotation = true
	# 开启碰撞检测
	self.contact_monitor = true
	# 最大碰撞检测次数
	self.max_contacts_reported = 1
	pass # Replace with function body.


func _process(_delta: float) -> void:
	pass
func _physics_process(_delta: float) -> void:
	var horizontal: float = Input.get_axis("左", "右")
	self.linear_velocity = Vector2(horizontal * 500, self.linear_velocity.y)
	pass


func _on_body_entered(_body: Node) -> void:
	print("碰到了", _body.name)
	pass # Replace with function body.
